import Vue from 'vue';
import store from '@/store';

Vue.directive('allow', {
    inserted: (el, binding) => {
        // 取出用户按钮级别权限
        const points = ['excel'];
        // const points = store.state["user/userInfo"].roles.points
        // 判断是否显示按钮
        if (points.includes(binding.value)) {
            return false;
        } else {
            // 移除
            el.parentNode.removeChild(el);
        }
    }
});
